﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MossDAL.DotNet
{
    [AttributeUsage(
       AttributeTargets.Field |
       AttributeTargets.Property,
       AllowMultiple = true)]
    public class SharepointListFieldAttribute : Attribute
    {
        public string FieldName { get; set; }
        public string ViewName { get; set; }
        public string ServiceFieldName
        {
            get
            {
                return "ows_" + FieldName;
            }
        }

        public SharepointListFieldAttribute(string fieldName)
        {
            FieldName = fieldName;
            ViewName = String.Empty;
        }
        public SharepointListFieldAttribute(string fieldName, string viewName)
        {
            FieldName = fieldName;
            ViewName = viewName;
        }
    }
}
